<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

</head>
<body>
    <div id="Div" style="background-color: red; height: 600px; width: 600px;" onclick="switchColor()"></div>
    <script>
        let Div = document.getElementById("Div");
        
        let currentColor = Div.style.backgroundColor;
        function switchColor() {
            Div.style.backgroundColor = "green";
            setTimeout(()=>Div.style.backgroundColor = currentColor, 1000);
        }
        
    </script>
</body>
</html>